package com.kwq.designPattern.generate.prototype;

/**
 * @author kangwanqiang
 * @date 2021/2/4
 * @description 原型模式测试类
 */
public class PrototypeClient {
    public static void main(String[] args) throws CloneNotSupportedException {
        DeepClone deepClone = new DeepClone("xiaoli", 11,
                new ConcretePrototype("xiaoming", 10));
        DeepClone clone = (DeepClone) deepClone.clone();

        System.out.println(deepClone.toString());
        System.out.println(clone.toString());
        System.out.println(deepClone.concretePrototype.hashCode()+"  "+clone.concretePrototype.hashCode());
    }
}
